<?
class FeiticoCureLightWounds extends Feitico {
	
	function __construct () {

		parent::__construct('curar pequenas feridas');
		
		//type: abjuration, conjuration
		$this->school = 'conjuration';
		$this->subschool = 'healing';
		
		// descriptor: 
		$this->classes_level = new ListaDeElementos();
		$this->classes_level->adiciona(array('brd', 1));
		$this->classes_level->adiciona(array('clr', 1));
		$this->classes_level->adiciona(array('drd', 1));
		$this->classes_level->adiciona(array('pal', 1));
		$this->classes_level->adiciona(array('rgr', 2));
		
		// types: verbal (v), somatic (s), material (m), focus (f), divine focus (df), XP Cost (xp) 
		$this->components = new ListaDeElementos();
		$this->components->adiciona('v');
		$this->components->adiciona('s');
		
		// types: standart action, free action, full round
		$this->casting_time		= 'standart';
		
		// types: personal, touch, close, medium, long, unlimited, nºfeets
		$this->range			= 'touch';
		
		//types: creatures, objects, area, line of effect (effects)
		$this->target			= 'creature';
		
		// types: intantaneous, timed duraction, permanent, concentration, (Subjects, Effects, and Areas), (Touch Spells and Holding the Charge), Discharge, Dismissible;
		$this->duration			= array('intantaneous', 0);
		
		// types: negates, partial, half, none, disbelief, object, harmless, Saving Throw Difficulty Class, Succeeding on a Saving Throw, Automatic Failures and Successes, 
		//Voluntarily Giving up a Saving Throw, Items Surviving after a Saving Throw
		// Items Affected by Magical Attacks: Shield, Armor, Magic helmet, hat, or headband, Item in hand (including weapon, wand), Magic cloak, etc...
		$this->saving_throw		= array('will', 'half');
		
		//types: true, false
		$this->spell_resistance	= true;
		
		// types: true, false
		$this->allow_permanent	= true;
	}
	
	public function activar(&$target) {
		$dado = new Dado(8);
		$thp = $dado->lancar(1,0) + ($target->getValue('level') > 5 ? 5 : $target->getValue('level'));
		$target->setValue('hp', $target->getValue('hp') + $thp);
		if ($this->duration[0] != 'instantaneous') $target->adicionaFeitico($this);
	}
	
	public function desactivar($target) {
		$target->removeFeitico($this);
	}
	
	public function getDuration() {
		return $this->duration;
	}
}
?>